/**
 * @使用变量长度数组计算fibonacci数
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
	int i, number;

	printf("Please enter a number:");
	scanf("%d", &number);

	//If the number entered is out of range, the end of the program
	if (number < 1 || number > 75) {
		printf("Bad number ,sorry!\n");
		return 1;
	}

	unsigned long long int Fibonacci[number];

	Fibonacci[0] = 0;
	Fibonacci[1] = 1;

	for (i=2; i<number; i++) {
		Fibonacci[i] = Fibonacci[i-2] + Fibonacci[i-1];
	}

	for (i=0; i<number; i++) {
		printf("%llu ", Fibonacci[i]);
	}

	printf("\n");

	return 0;
}
